package com.grass.p019lv.novel.adapter;

import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.androidsa.bttsddka.R;
import com.androidx.p013lv.base.glide.GlideUtils;
import com.androidx.p013lv.base.recycler.BaseRecyclerAdapter;
import com.androidx.p013lv.base.recycler.BaseRecyclerHolder;
import com.androidx.p013lv.base.utils.UiUtils;
import com.grass.p019lv.bean.AudioRecommendBean;

/* renamed from: com.grass.lv.novel.adapter.AudioFictionOneViewAdapter */
public class AudioFictionOneViewAdapter extends BaseRecyclerAdapter<AudioRecommendBean.AudioRecommendBeanData.FictionBaseListBean, Holder> {
    String domain;

    public void setDomain(String str) {
        this.domain = str;
    }

    public void MyHolder(Holder holder, int i) {
        holder.setData((AudioRecommendBean.AudioRecommendBeanData.FictionBaseListBean) this.list.get(i), i);
    }

    public void onViewRecycled(Holder holder) {
        super.onViewRecycled((RecyclerView.ViewHolder) holder);
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public Holder onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new Holder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_audio_fiction_bs, viewGroup, false));
    }

    /* access modifiers changed from: package-private */
    /* renamed from: com.grass.lv.novel.adapter.AudioFictionOneViewAdapter$Holder */
    public class Holder extends BaseRecyclerHolder {
        ImageView iv_cover;
        LinearLayout ll_audio_layout;
        RelativeLayout rl_content;
        TextView tv_favorites_num;
        TextView tv_listen_num;
        TextView tv_title;

        public Holder(View view) {
            super(view);
            this.ll_audio_layout = (LinearLayout) view.findViewById(R.id.ll_audio_layout);
            this.rl_content = (RelativeLayout) view.findViewById(R.id.rl_content);
            this.iv_cover = (ImageView) view.findViewById(R.id.iv_cover);
            this.tv_listen_num = (TextView) view.findViewById(R.id.tv_listen_num);
            this.tv_favorites_num = (TextView) view.findViewById(R.id.tv_favorites_num);
            this.tv_title = (TextView) view.findViewById(R.id.tv_title);
            ViewGroup.LayoutParams layoutParams = this.rl_content.getLayoutParams();
            layoutParams.width = (UiUtils.getWindowWidth() - UiUtils.dp2px(92)) / 3;
            layoutParams.height = UiUtils.dp2px(112);
            this.rl_content.setLayoutParams(layoutParams);
            this.ll_audio_layout.setPadding(0, UiUtils.dp2px(20), 0, 0);
        }

        public void setData(AudioRecommendBean.AudioRecommendBeanData.FictionBaseListBean fictionBaseListBean, int i) {
            if (fictionBaseListBean.getCoverImg() == null || TextUtils.isEmpty(fictionBaseListBean.getCoverImg())) {
                GlideUtils.loadCropRadiusDefault(6, this.iv_cover);
            } else {
                GlideUtils.loadCropRadiusWh2(AudioFictionOneViewAdapter.this.domain + fictionBaseListBean.getCoverImg(), 6, this.iv_cover, 600);
            }
            TextView textView = this.tv_listen_num;
            textView.setText(UiUtils.num2str(fictionBaseListBean.getFakeWatchTimes()) + "");
            TextView textView2 = this.tv_favorites_num;
            textView2.setText(UiUtils.num2str(fictionBaseListBean.getFakeLikes()) + "");
            TextView textView3 = this.tv_title;
            textView3.setText(fictionBaseListBean.getFictionTitle() + "");
        }
    }
}
